package com.fyw.kotlin.ui

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.view.Window
import com.fyw.kotlin.R
import com.fyw.kotlin.base.BaseActivity
import kotlinx.android.synthetic.main.activity_login.*

/**
 * 登录界面
 * Created by FYW on 2017/9/28.
 */
class LoginActivity : BaseActivity(), View.OnClickListener {

    override fun initParam(param: Bundle?) {
        //去除标题栏
        requestWindowFeature(Window.FEATURE_NO_TITLE)
    }

    override fun bindLayout(): Int {
        return R.layout.activity_login
    }

    override fun initView(view: View) {
    }

    override fun doBusiness(mContext: Context) {
        loginBtn.setOnClickListener(this)
        registerTvBtn.setOnClickListener(this)
        forgetPwdTvBtn.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.loginBtn -> { //登录按钮->进入应用
                startActivity(Intent(this, RegisterActivity::class.java))
            }

            R.id.registerTvBtn -> { //跳转至注册页面
                startActivity(Intent(this, RegisterActivity::class.java))
            }

            R.id.forgetPwdTvBtn -> {//忘记密码
                startActivity(Intent(this, ForgetPwdActivity::class.java))
            }
        }
    }

}